/**
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.google.code.japidiff;

import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.Attribute;
import org.objectweb.asm.Label;

public class JavaMethodBuilder implements MethodVisitor {

    private JavaMethod method;

    public JavaMethodBuilder(JavaMethod method) {
        this.method = method;
    }

    public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
        JavaAnnotation anno = new JavaAnnotation();
        anno.setDesc(desc);
        anno.setVisible(visible);
        this.method.addAnnotation(anno);
        return new JavaAnnotationBuilder(anno);
    }

    public AnnotationVisitor visitAnnotationDefault() {
        JavaAnnotation anno = new JavaAnnotation();
        anno.setDefault(true);
        this.method.addAnnotation(anno);
        return new JavaAnnotationBuilder(anno);
    }
    public void visitAttribute(Attribute attribute) {
        method.addAttribute(attribute);
    }
    public void visitCode() {
    }
    public void visitEnd() {
    }
    public void visitFieldInsn(int arg0, String arg1, String arg2, String arg3) {
    }
    public void visitIincInsn(int arg0, int arg1) {
    }
    public void visitInsn(int arg0) {
    }
    public void visitIntInsn(int arg0, int arg1) {
    }
    public void visitJumpInsn(int arg0, Label arg1) {
    }
    public void visitLabel(Label arg0) {
    }
    public void visitLdcInsn(Object arg0) {
    }
    public void visitLineNumber(int arg0, Label arg1) {
    }
    public void visitLocalVariable(String arg0, String arg1, String arg2, Label arg3, Label arg4, int arg5) {
    }
    public void visitLookupSwitchInsn(Label arg0, int[] arg1, Label[] arg2) {
    }
    public void visitMaxs(int arg0, int arg1) {
    }
    public void visitMethodInsn(int arg0, String arg1, String arg2, String arg3) {
    }
    public void visitMultiANewArrayInsn(String arg0, int arg1) {
    }
    public AnnotationVisitor visitParameterAnnotation(int arg0, String arg1, boolean arg2) {
        return null;
    }
    public void visitTableSwitchInsn(int arg0, int arg1, Label arg2, Label[] arg3) {
    }
    public void visitTryCatchBlock(Label arg0, Label arg1, Label arg2, String arg3) {
    }
    public void visitTypeInsn(int arg0, String arg1) {
    }
    public void visitVarInsn(int arg0, int arg1) {
    }
    public void visitFrame(int i, int i1, Object[] objects, int i2, Object[] objects1) {
    }
}
